package com.qijian.business.domain.query;

import com.baomidou.mybatisplus.annotation.TableName;
import com.qijian.common.utils.mybatis.WhereType;
import com.qijian.common.utils.mybatis.WhereTypeEnum;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * 工单对象 查询条件类
 *
 * @author qijian
 * @date 2024-02-27
 */

@Data
@ToString
@TableName("kr_work_feed")
public class KrWorkFeedQuery {

    @WhereType(filed = "inventory_id")
    private Long inventoryId;

    @WhereType(filed = "number", tableName = "kr_work_order", type = WhereTypeEnum.LIKE)
    private String number;

    @WhereType(filed = "order_no", tableName = "kr_work_order", type = WhereTypeEnum.LIKE)
    private String orderNo;

    @WhereType(filed = "feed_no",type = WhereTypeEnum.LIKE)
    private String feedNo;

    @WhereType(filed = "item_code",type = WhereTypeEnum.LIKE)
    private String itemCode;

    @WhereType(filed = "item_spec",tableName = "main_item",type = WhereTypeEnum.LIKE)
    private String itemSpec;

    @WhereType(filed = "item_name",type = WhereTypeEnum.LIKE)
    private String itemName;

    @WhereType(filed = "item_code",tableName = "orderItem",type = WhereTypeEnum.LIKE)
    private String endItemCode;

    @WhereType(filed = "item_spec",tableName = "orderItem",type = WhereTypeEnum.LIKE)
    private String endItemSpec;

    @WhereType(filed = "item_name", tableName = "orderItem", type = WhereTypeEnum.LIKE)
    private String endItemName;

    @WhereType(filed = "internal_number", tableName = "sd_inventory",type = WhereTypeEnum.LIKE)
    private String internalNumber;

    @WhereType(filed = "internal_number", type = WhereTypeEnum.IN)
    private List<String> internalNumberList;

    @WhereType(filed = "inventory_id", type = WhereTypeEnum.IN)
    private List<Long> inventoryIds;

    @WhereType(filed = "create_time",type = WhereTypeEnum.BETWEEN)
    private Date[] createTimes;

    @WhereType(filed = "feed_qty", type = WhereTypeEnum.BETWEEN)
    private BigDecimal[] feedQtys;

    @WhereType(filed = "feed_qty")
    private BigDecimal feedQty;

    @WhereType(filed = "dimensional_barcode", tableName = "sd_inventory",type = WhereTypeEnum.LIKE)
    private String dimensionalBarcode;

    @WhereType(filed = "source_id",type = WhereTypeEnum.EQ)
    private Long sourceId;

    @WhereType(filed = "parent_id",type = WhereTypeEnum.EQ)
    private Long parentId;

    @WhereType(filed = "status",type = WhereTypeEnum.EQ)
    private String status;

    @WhereType(filed = "circulation_no",type = WhereTypeEnum.LIKE)
    private String circulationNo;

    @WhereType(filed = "id",type = WhereTypeEnum.IN)
    private List<Long> ids;

    @WhereType(func = "kr_work_feed.feed_qty != 0 AND sd_inventory.qty > sd_inventory.out_qty")
    private Boolean zeroFeedQty;

    @WhereType(filed = "circulation_no", tableName = "kr_order_detail_pre_feed", type = WhereTypeEnum.EQ)
    private String circulationNos;

    @WhereType(filed = "status", tableName = "sd_inventory", type= WhereTypeEnum.EQ)
    private String inventoryStatus;

    @WhereType(filed = "parent_id", tableName = "kr_work_order", type = WhereTypeEnum.EQ)
    private Long workOrderParentId;

    @WhereType(filed = "number", tableName = "sd_inventory", type = WhereTypeEnum.EQ)
    private String  sdNumber;

    @WhereType(filed = "use_status",type = WhereTypeEnum.EQ)
    private Boolean useStatus;

    @WhereType(filed = "feed_status",type = WhereTypeEnum.EQ)
    private String feedStatus;

    @WhereType(filed = "source_id",type = WhereTypeEnum.IN)
    private List<Long> sourceIds;

    @WhereType(filed = "dispatch_id",type = WhereTypeEnum.IN)
    private List<Long> dispatchIds;

    private Date[] useTime;

    private Date startTime;
    private Date endTime;

    private String itemOwnership;

    @WhereType(filed = "id",  type = WhereTypeEnum.EQ)
    private Long feedId;


}
